//
//  ViewController.m
//  SoundPlayer
//
//  Created by iD Student on 6/24/13.
//  Copyright (c) 2013 iD Student. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"rocks" withExtension: @"mp3"];
    NSError *error;
    rockSound = [[AVAudioPlayer alloc] initWithContentsOfURL:url error: &error];
    if (error!=nil)
    {
        NSLog(@"Rock sound could not be loaded!");
    }
    else{
        [rockSound prepareToPlay];
    }
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction) explosionButtonPressed: (id) sender
{
    [rockSound play];
}

@end
